#include "Headers.h"
#include "UIImageManager.h"


CUIImageManager::CUIImageManager(void)
{
}


CUIImageManager::~CUIImageManager(void)
{
}

bool CUIImageManager::AddUIImage(int resource, int x, int y)
{
	CUIImage* tempUI = NULL;
	tempUI = new CUIImage();
	if(tempUI->Initialize(resource, x, y) == false)
	{
		return false;
	}

	m_UIRepository.push_back(tempUI);

	return true;
}

void CUIImageManager::RemoveUIImage()
{
	std::vector<CUIImage*>::iterator iter;

	for(iter = m_UIRepository.begin(); iter != m_UIRepository.end(); ++iter)
	{
		(*iter)->Uninitialize();
		delete (*iter);
	}

	m_UIRepository.clear();
}

void CUIImageManager::Render(HDC hdc)
{
	std::vector<CUIImage*>::iterator iter;

	for(iter = m_UIRepository.begin(); iter != m_UIRepository.end(); ++iter)
	{
		(*iter)->Render(hdc);
	}
}